/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufc.quixada.adrs.service;

import br.ufc.quixada.adrs.dao.RebanhoDAO;
import br.ufc.quixada.adrs.model.Rebanho;
import br.ufc.quixada.adrs.util.Msg;
import java.sql.SQLException;
import org.slf4j.LoggerFactory;

/**
 *
 * @author fernando
 */
public class RebanhoService {

    private final RebanhoDAO dao = new RebanhoDAO();

    public void insertRebanho(Rebanho rebanho) {
        try {
            dao.insert(rebanho);
        } catch (SQLException ex) {
            LoggerFactory.getLogger(this.getClass()).error(Msg.EXCEPTION_MESSAGE, this.getClass().getSimpleName(), ex);
        }
    }

    public void deleteRebanho(Long id) {
        try {
            dao.delete(id);
        } catch (SQLException ex) {
            LoggerFactory.getLogger(this.getClass()).error(Msg.EXCEPTION_MESSAGE, this.getClass().getSimpleName(), ex);
        }
    }
}
